package com.example.utils.thread;


import com.example.model.wemedia.pojo.User;

public class WmThreadLocal {

    private final static ThreadLocal< User > WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    /**
     * 添加用户
     * @param wmUser
     */
    public static void  setUser(User user){
        WM_USER_THREAD_LOCAL.set(user);
    }

    /**
     * 获取用户
     */
    public static User getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }

    /**
     * 清理用户
     */
    public static void remove(){
        WM_USER_THREAD_LOCAL.remove();
    }
}